package com.mz.ozy.mvp.model;

import android.app.Activity;
import android.content.Context;

import com.mz.ozy.constants.Constants;
import com.mz.ozy.net.RetrofitUtils;
import com.mz.ozy.utils.JsonUtils;

import java.util.HashMap;
import java.util.Map;

import io.reactivex.Observable;
import okhttp3.ResponseBody;

/**
 * Created by administrator on 2018/12/3.
 */
public class ReceiveAccountModel {

    public Observable<ResponseBody> saveAccount(Activity activity, String s, String ali, String name, String bankCardNumber, String bankAccount, String alipayAccount, String alipayCollectionCode) {
        Map<String, String> maps = new HashMap<>();
        maps.put("payee", s);
        maps.put("alipay", ali);
        maps.put("wechat", name);
        maps.put("bank_id", bankCardNumber);
        maps.put("bank_name", bankAccount);
        maps.put("bank_account", alipayAccount);
        maps.put("code",alipayCollectionCode );

        return RetrofitUtils.getApiService(activity).post(Constants.TransCode.TransCode10015, JsonUtils.requestJsonDate(maps), Constants.tokenId);

    }

    public Observable<ResponseBody> queryAccount(Context context) {
        Map<String, String> maps = new HashMap<>();
        return RetrofitUtils.getApiService(context).post(Constants.TransCode.TransCode10123, JsonUtils.requestJsonDate(maps), Constants.tokenId);

    }
    public Observable<ResponseBody> getBindInfo(Context context,String type,String id) {
        Map<String, String> maps = new HashMap<>();
        maps.put("type",type);
        maps.put("id",id);
        return RetrofitUtils.getApiService(context).post(Constants.TransCode.TransCode10065, JsonUtils.requestJsonDate(maps), Constants.tokenId);

    }
    public Observable<ResponseBody> getBank(Context context) {
        Map<String, String> maps = new HashMap<>();
        return RetrofitUtils.getApiService(context).post(Constants.TransCode.TransCode10061, JsonUtils.requestJsonDate(maps), Constants.tokenId);

    }
}
